import java.awt.*;
import java.awt.event.*;
import javax.print.attribute.standard.JobOriginatingUserName;
import javax.swing.*;
/*
 * Created by JFormDesigner on Tue Jul 02 13:21:24 CST 2024
 */



/**
 * @author ASUS
 */
 public class LoginFrame extends JFrame {
    public LoginFrame() {
        initComponents();
    }

    public void Login(ActionEvent e) {
        // TODO add your code here

       String UserName = textField1.getText();
       String PassWord = textField2.getText();
        if (UserName.equals("123456")&&PassWord.equals("123456")) {
            Main main = new Main();


        }
        else System.out.println("用户名或密码错误！");

    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents  @formatter:off
        // Generated using JFormDesigner Open Source Project license - 淘宝星河飘雪
        label1 = new JLabel();
        label2 = new JLabel();
        textField1 = new JTextField();
        textField2 = new JTextField();
        button1 = new JButton();

        //======== this ========
        setTitle("\u767b\u5f55");
        var contentPane = getContentPane();
        contentPane.setLayout(null);

        //---- label1 ----
        label1.setText("\u7528\u6237\u540d");
        contentPane.add(label1);
        label1.setBounds(20, 65, 55, 35);

        //---- label2 ----
        label2.setText("\u5bc6\u7801");
        contentPane.add(label2);
        label2.setBounds(20, 150, 55, 35);
        contentPane.add(textField1);
        textField1.setBounds(80, 75, 235, textField1.getPreferredSize().height);
        contentPane.add(textField2);
        textField2.setBounds(80, 160, 235, 24);

        //---- button1 ----
        button1.setText("\u767b\u5f55");
        button1.addActionListener(e -> Login(e));
        contentPane.add(button1);
        button1.setBounds(115, 265, 150, button1.getPreferredSize().height);

        {
            // compute preferred size
            Dimension preferredSize = new Dimension();
            for(int i = 0; i < contentPane.getComponentCount(); i++) {
                Rectangle bounds = contentPane.getComponent(i).getBounds();
                preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
            }
            Insets insets = contentPane.getInsets();
            preferredSize.width += insets.right;
            preferredSize.height += insets.bottom;
            contentPane.setMinimumSize(preferredSize);
            contentPane.setPreferredSize(preferredSize);
        }
        pack();
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents  @formatter:on
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables  @formatter:off
    // Generated using JFormDesigner Open Source Project license - 淘宝星河飘雪
    private JLabel label1;
    private JLabel label2;
    private JTextField textField1;
    private JTextField textField2;
    private JButton button1;
    // JFormDesigner - End of variables declaration  //GEN-END:variables  @formatter:on

    public static void main(String[] args) {
        LoginFrame loginFrame = new LoginFrame();
        loginFrame.setVisible(true);

    }
}

